<style type="text/css">
    .layui-form-select dl{z-index:9999;}
</style>
<form class="layui-form" action="{:url()}" method="post" id="editForm">
    <div class="layui-form-item">
        <label class="layui-form-label">类型</label>
        <div class="layui-input-inline w200">
            <input type="text" class="layui-input field" autocomplete="off" value="{$formData['fp_type']==0?'单位':($formData['fp_type']==1?'个人':'专票')}" disabled="disabled">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">抬头名称</label>
        <div class="layui-input-inline w200">
            <input type="text" class="layui-input field-fp_title" name="fp_title" autocomplete="off" disabled="disabled">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">税号</label>
        <div class="layui-input-inline w200">
            <input type="text" class="layui-input field-taxNumber" name="taxNumber" autocomplete="off" disabled="disabled">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">单位地址</label>
        <div class="layui-input-inline w200">
            <input type="text" class="layui-input field-companyAddress" name="companyAddress" autocomplete="off" disabled="disabled">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">电话</label>
        <div class="layui-input-inline w200">
            <input type="text" class="layui-input field-telephone" name="telephone" autocomplete="off" disabled="disabled">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">银行名称</label>
        <div class="layui-input-inline w200">
            <input type="text" class="layui-input field-bankName" name="bankName" autocomplete="off" disabled="disabled">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">银行账号</label>
        <div class="layui-input-inline w200">
            <input type="text" class="layui-input field-bankAccount" name="bankAccount" autocomplete="off" disabled="disabled">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">发票收件人姓名</label>
        <div class="layui-input-inline w200">
            <input type="text" class="layui-input field-fapiao_name" name="fapiao_name" autocomplete="off" disabled="disabled">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">发票收件地址</label>
        <div class="layui-input-inline w200">
            <input type="text" class="layui-input field-fapiao_address" name="fapiao_address" autocomplete="off" disabled="disabled">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">发票邮箱地址</label>
        <div class="layui-input-inline w200">
            <input type="text" class="layui-input field-fapiao_email" name="fapiao_email" autocomplete="off" disabled="disabled">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">发票图片</label>
            <div class="layui-input-inline upload1">
                <button type="button" name="fapiao_pic" class="layui-btn layui-btn-primary layui-upload1" lay-type="image" lay-data="{accept:'image'}">请上传图片</button>
                <input type="hidden" class="upload-input field-fapiao_pic" name="fapiao_pic">
                {if condition="!empty($formData['fapiao_pic'])"}
                <img src="{$formData['fapiao_pic']}" style="border-radius:5px;border:1px solid #ccc">
                {else /}
                <img src="" style="display:none;border-radius:5px;border:1px solid #ccc" width="36" height="36">
                {/if}
            </div>
            <!-- <div class="layui-form-mid layui-word-aux">作用于商城列表、分享头图；建议尺寸：750*750像素</div> -->
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <input type="hidden" name="id" value="{$id}">
            <button type="submit" class="layui-btn layui-btn-normal" hisi-data="{pop: true, refresh: true}" lay-submit="" lay-filter="formSubmit">确认开票</button>
            <a href="javascript:parent.layui.layer.closeAll();" class="layui-btn layui-btn-primary ml10">取消</a>
        </div>
    </div>

</form>
{include file="system@block/layui" /}

<script>
var s = "";
layui.use(['func'], function() {
    layui.func.assign({:json_encode($formData)});
});

layui.use(["jquery", "upload", "form", "layer", "element"], function () {
    var $ = layui.$,
    element = layui.element,
    layer = layui.layer,
    upload = layui.upload,
    form = layui.form;
    upload.render({
        elem: '.layui-upload1'
        ,url: '{:url("system/annex/upload?water=&thumb=&from=&group=")}'
        ,method: 'post'
        ,before: function(input) {
            layer.msg('文件上传中...', {time:3000000});
        },done: function(res, index, upload) {
            console.log(res);
            var obj = this.item;
            if (res.code == 0) {
                layer.msg(res.msg);
                return false;
            }
            layer.closeAll();
            var input = $(obj).parents('.upload1').find('.upload-input');
            if ($(obj).attr('lay-type') == 'image') {
                input.siblings('img').attr('src', res.data.file).show();
            }
            input.val(res.data.file);
        }
    });
})

</script>